From: Vit Stanislav Date: Mon, 16 Jan 2012 12:01:18 +0000 (+0100) Subject: Calendar: make current date label clickable X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2683 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c07421c195beb3a3228bd31a92f988394509ff61;p=gnome-shell.git Calendar: make current date label clickable Once you start navigating between months, you can't return to the current day. However, the current day is always displayed above the calendar grid. Fix this by making the current date clickable; when clicked, the calendar grid jumps back to that day. https://bugzilla.gnome.org/show_bug.cgi?id=641366 --- diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 613ae0ca3..ac33643eb 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -1304,12 +1304,18 @@ StScrollBar StButton#vhandle:active { font-weight: bold; text-align: center; color: #eeeeec; + border-radius: 4px; } +.datemenu-date-label:hover, .datemenu-date-label:focus { background-color: #999999; } +.datemenu-date-label:active { + background-color: #aaaaaa; +} + .calendar-day-base { font-size: 9pt; text-align: center; diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index ee36019dc..e86960706 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -63,9 +63,14 @@ const DateMenuButton = new Lang.Class({ hbox.add(vbox); // Date - this._date = new St.Label({ style_class: 'datemenu-date-label', - can_focus: true }); - vbox.add(this._date); + this._date = new St.Button({ style_class: 'datemenu-date-label', + can_focus: true, + }); + this._date.connect('clicked', + Lang.bind(this, function() { + this._calendar.setDate(new Date(), false); + })); + vbox.add(this._date, { x_fill: false }); this._eventList = new Calendar.EventsList(); this._calendar = new Calendar.Calendar(); @@ -186,7 +191,7 @@ const DateMenuButton = new Lang.Class({ */ let dateFormat = _("%A %B %e, %Y"); let displayDate = new Date(); - this._date.set_text(displayDate.toLocaleFormat(dateFormat)); + this._date.set_label(displayDate.toLocaleFormat(dateFormat)); }, _getCalendarApp: function() {